package com.domain;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

/**
*@Author: 喻晓涵
*@CreateTime: 2025-08-05
*@Description: ${description}
*@Version: 1.0
*/


/**
 * 答案表
 */
@Data
public class Answer implements java.io.Serializable{
    /**
    * 答案ID，主键自增
    */
    @NotNull(message = "答案ID，主键自增不能为null")
    @JsonProperty("id")
    private Long id;

    /**
    * 关联的问题ID
    */
    @NotNull(message = "关联的问题ID不能为null")
    @JsonProperty("questionId")
    private Long questionId;

    /**
    * 答案文本
    */
    @Size(max = 500,message = "答案文本最大长度要小于 500")
    @JsonProperty("content")
    private String content;

    /**
    * 是否正确(1-正确 2-错误)
    */
    @NotNull(message = "是否正确(1-正确 2-错误)不能为null")
    @JsonProperty("isCorrect")
    private Byte isCorrect;

    // Getter 和 Setter 方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getQuestionId() {
        return questionId;
    }

    public void setQuestionId(Long questionId) {
        this.questionId = questionId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Byte getIsCorrect() {
        return isCorrect;
    }

    public void setIsCorrect(Byte isCorrect) {
        this.isCorrect = isCorrect;
    }
    @Override
    public String toString() {
        return "Answer{" +
                "id=" + id +
                ", questionId=" + questionId +
                ", content='" + content + '\'' +
                ", isCorrect=" + isCorrect +
                '}';
    }
}